<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    行：<input type="text" name="" id="row">
    列：<input type="text" name="" id="col">
    <input type="button" name="" id="btn"  value="生成表格" onclick="excel()">

    <table id="tb" border="1px" cellpadding="10px" >

    </table>

<script>
    function excel() {

        let rowValue = document.getElementById("row").value;
        let colValue = document.getElementById("col").value;
        let tb = document.getElementById("tb");
        tb.innerHTML='';
        for (let i = 1;i<=rowValue;i++){
            let rowElement = document.createElement("tr");
            for (let j =1;j<=colValue;j++){
                let cellElement = document.createElement("td");
                cellElement.innerHTML = '传智播客';
                rowElement.appendChild(cellElement);
            }
            tb.appendChild(rowElement);
        }
    }
</script>
</body>
</html>